package problem;

import main.Main;
import env.Move;
import env.World;

public class logic {
	public static int calcCost(Move move) {
		if (move == null) // no-op
			return Main.noOpCost;
		int ans = move.road.getCost();
		// cost multipliers
		if (move.chems)
			ans *= 2;
		if (move.escort)
			ans *= 2;

		if (move.road.isBlocked() && move.chems && !move.escort)
			return Main.hellBreakLooseCost; // we die, return hell breaking loose cost
		return ans;
	}
	public static int calcCost(World world,Move move) {
		if (move == null) // no-op
			return Main.noOpCost;
		int ans = move.road.getCost();
		// cost multipliers
		if (move.chems)
			ans *= 2;
		if (move.escort)
			ans *= 2;

		if (world.getRoadBetweenCities(move.from, move.to).isBlocked() && move.chems && !move.escort)
			return Main.hellBreakLooseCost; // we die, return hell breaking loose cost
		return ans;
	}
}
